package com.zyh.homework.test01;

import java.util.Scanner;

public class Test1 {
    public static void main(String[] args) {
        System.out.println("请输入一个字符串");
        String str = new Scanner(System.in).next();
        System.out.println("录入的字符串："+str);
        char[] chs = str.toCharArray();
        for (int start=0, end=chs.length-1;start<=end;start++,end--){
            char temp=chs[start];
            chs[start]=chs[end];
            chs[end]=temp;
        }
        System.out.print("反转的字符串：");
        for (int i=0;i<chs.length;i++) {
            System.out.print(chs[i]);
        }
    }
}
